package mn.slide.labmed.info;

import mn.slide.labmed.MyDialog;
import mn.slide.labmed.R;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

public class ImpressumActivity extends Activity
{
	public static String	title;
	public static String	url;
	public static TextView	locationName;
	public static TextView	locationDescription;

	@Override
	public void onCreate( Bundle savedInstanceState )
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.imper);

		findViewById(R.id.zuruckimpress).setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				InfoTabGroupActivity.group.back();
			}
		});
		EditText searchbox = (EditText) findViewById(R.id.imper_search);
		searchbox.setOnKeyListener(new View.OnKeyListener()
		{

			public boolean onKey( View v , int keyCode , KeyEvent event )
			{
				if (keyCode == KeyEvent.KEYCODE_ENTER)
				{
					EditText searchbox = (EditText) v;

					InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
					imm.hideSoftInputFromWindow(searchbox.getWindowToken(), 0);
					InfoTabGroupActivity.group.goSearchActivity(searchbox.getText().toString());
				}
				return false;
			}
		});
		findViewById(R.id.impreslabmed).setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				Intent intent = new Intent(ImpressumActivity.this, MyDialog.class);
				Bundle bundle = new Bundle();
				bundle.putString("title", "www.labmed.de");
				intent.putExtras(bundle);
				startActivity(intent);

			}

		});
		findViewById(R.id.impresadt).setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				Intent intent = new Intent(ImpressumActivity.this, MyDialog.class);
				Bundle bundle = new Bundle();
				bundle.putString("title", "www.adtextum.de");
				intent.putExtras(bundle);
				startActivity(intent);
			}
		});
		findViewById(R.id.impressilde).setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				Intent intent = new Intent(ImpressumActivity.this, MyDialog.class);
				Bundle bundle = new Bundle();
				bundle.putString("title", "www.slide.mn");
				intent.putExtras(bundle);
				startActivity(intent);
			}
		});
		findViewById(R.id.imprespro).setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				Intent intent = new Intent(ImpressumActivity.this, MyDialog.class);
				Bundle bundle = new Bundle();
				bundle.putString("title", "www.proforma.de");
				intent.putExtras(bundle);
				startActivity(intent);
			}
		});
		findViewById(R.id.impresinfo).setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				// TODO Auto-generated method stub
				Intent intent = new Intent(android.content.Intent.ACTION_SEND);
				intent.setType("text/plain");
				intent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "info@ridili.de" });
				intent.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
				intent.putExtra(Intent.EXTRA_TEXT, "body of email");
				startActivity(Intent.createChooser(intent, "Send mail"));
			}
		});

	}
}
